/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * POS_MainOut.java
 *
 * Created on Apr 4, 2011, 12:30:34 PM
 */

package POS_Source;

import POS_Controller.POSController;
import Session.POS_SessionManager;
import Utilities.MoneyFormatter;
import javax.swing.JPanel;

/**
 *
 * @author edaype
 */
public class POS_MainOut extends javax.swing.JPanel {

    private POSController controller;
    private MoneyFormatter moneyFormatter;
    private POS_SessionManager sessionManager;

    /** Creates new form POS_MainOut */
    public POS_MainOut(POSController control) {
        initComponents();
        controller = control;
        sessionManager = controller.getSessionManager();
        moneyFormatter = new MoneyFormatter();
        customInit();
    }


    private void customInit(){
        setTotals();

        modeDetails();
    }

    public void changeScreen(JPanel panel){
        DynamicPanel4.removeAll();
        panel.setBounds(0,0, 800,600);
        DynamicPanel4.add(panel);
        DynamicPanel4.validate();
        DynamicPanel4.repaint();
        setTotals();
        modeDetails();
    }

    private void modeDetails(){
        // If no store card in session
        if (!sessionManager.getLoggedIn()){
            HelloLabel.setVisible(false);
            NameLabel.setVisible(false);
        }
        // If store card has been added to session
        else{
            NameLabel.setText(sessionManager.getCustomer().getFirstName());
            HelloLabel.setVisible(true);
            NameLabel.setVisible(true);
            AddStoreCardButton.setText("Remove Store Card");
        }

        // If Clerk is logged in
        if (sessionManager.isClerkLoggedIn()){
            WelcomeLabel.setText("Clerk Mode");
            LoginButton.setText("Clerk Logout");
        }
    }

    public void setTotals(){
        DiscountOut.setText(moneyFormatter.format(controller.getCart().getTotalDiscount()));
        NumberLabel.setText(controller.getNumItemsInCart());
        SubTotalOut.setText(moneyFormatter.format(controller.getCart().getSubtotal()));
        TaxOut.setText(moneyFormatter.format(controller.getCart().getTaxAmount()));
        TotalOut.setText(moneyFormatter.format(controller.getCart().getTotal()));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        DynamicPanel4 = new javax.swing.JPanel();
        TitlePanel = new javax.swing.JPanel();
        LoginButton = new javax.swing.JButton();
        WelcomeLabel = new javax.swing.JLabel();
        LogoLabel = new javax.swing.JLabel();
        NameLabel = new javax.swing.JLabel();
        HelloLabel = new javax.swing.JLabel();
        OptionsPanel = new javax.swing.JPanel();
        SearchButton = new javax.swing.JButton();
        CartPanel = new javax.swing.JPanel();
        CartLabel1 = new javax.swing.JLabel();
        CartLabel2 = new javax.swing.JLabel();
        CheckoutButton = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        SubTotalOut = new javax.swing.JLabel();
        SubTotalLabel1 = new javax.swing.JLabel();
        DiscountOut = new javax.swing.JLabel();
        TaxOut = new javax.swing.JLabel();
        TotalOut = new javax.swing.JLabel();
        NumberLabel = new javax.swing.JLabel();
        TaxLabel = new javax.swing.JLabel();
        ItemLabel = new javax.swing.JLabel();
        SubTotalLabel = new javax.swing.JLabel();
        TotalLabel = new javax.swing.JLabel();
        SearchResultsButton = new javax.swing.JButton();
        AddStoreCardButton = new javax.swing.JButton();
        ISLabel = new javax.swing.JLabel();

        setBackground(new java.awt.Color(255, 255, 255));
        setPreferredSize(new java.awt.Dimension(1065, 800));

        DynamicPanel4.setBackground(new java.awt.Color(255, 255, 255));
        DynamicPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        DynamicPanel4.setMaximumSize(new java.awt.Dimension(800, 600));
        DynamicPanel4.setPreferredSize(new java.awt.Dimension(800, 600));
        DynamicPanel4.setSize(new java.awt.Dimension(800, 600));

        javax.swing.GroupLayout DynamicPanel4Layout = new javax.swing.GroupLayout(DynamicPanel4);
        DynamicPanel4.setLayout(DynamicPanel4Layout);
        DynamicPanel4Layout.setHorizontalGroup(
            DynamicPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 798, Short.MAX_VALUE)
        );
        DynamicPanel4Layout.setVerticalGroup(
            DynamicPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 598, Short.MAX_VALUE)
        );

        TitlePanel.setBackground(new java.awt.Color(255, 255, 255));
        TitlePanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        LoginButton.setFont(new java.awt.Font("Tahoma", 0, 18));
        LoginButton.setText("Clerk Login");
        LoginButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LoginButtonActionPerformed(evt);
            }
        });

        WelcomeLabel.setFont(new java.awt.Font("Tahoma", 1, 24));
        WelcomeLabel.setText("Thank you for shopping at DigiStore");

        LogoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/POS_Source/images/Logo.png"))); // NOI18N

        NameLabel.setFont(new java.awt.Font("Tahoma", 0, 24));
        NameLabel.setText("John Doe");

        HelloLabel.setFont(new java.awt.Font("Tahoma", 0, 24));
        HelloLabel.setText("Hello!");

        javax.swing.GroupLayout TitlePanelLayout = new javax.swing.GroupLayout(TitlePanel);
        TitlePanel.setLayout(TitlePanelLayout);
        TitlePanelLayout.setHorizontalGroup(
            TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TitlePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(LogoLabel)
                .addGap(131, 131, 131)
                .addGroup(TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(WelcomeLabel)
                    .addGroup(TitlePanelLayout.createSequentialGroup()
                        .addComponent(HelloLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(NameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE)
                .addComponent(LoginButton, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29))
        );
        TitlePanelLayout.setVerticalGroup(
            TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TitlePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(TitlePanelLayout.createSequentialGroup()
                        .addComponent(LogoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(TitlePanelLayout.createSequentialGroup()
                        .addComponent(WelcomeLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(NameLabel)
                            .addComponent(HelloLabel))
                        .addGap(22, 22, 22))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TitlePanelLayout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addComponent(LoginButton, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                .addContainerGap())
        );

        OptionsPanel.setBackground(new java.awt.Color(255, 255, 255));
        OptionsPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        SearchButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        SearchButton.setText("Search");
        SearchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SearchButtonActionPerformed(evt);
            }
        });

        CartPanel.setBackground(new java.awt.Color(255, 255, 255));

        CartLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
        CartLabel1.setText("Your");

        CartLabel2.setFont(new java.awt.Font("Tahoma", 0, 24));
        CartLabel2.setText("Cart");

        CheckoutButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        CheckoutButton.setText("View Cart");
        CheckoutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CheckoutButtonActionPerformed(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        SubTotalOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        SubTotalOut.setText("$00.00");

        SubTotalLabel1.setFont(new java.awt.Font("Tahoma", 0, 14));
        SubTotalLabel1.setText("Discount:");

        DiscountOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        DiscountOut.setText("$00.00");

        TaxOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        TaxOut.setText("$00.00");

        TotalOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        TotalOut.setText("$00.00");

        NumberLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        NumberLabel.setText("0");

        TaxLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        TaxLabel.setText("Tax:");

        ItemLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        ItemLabel.setText("Items in Cart: ");

        SubTotalLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        SubTotalLabel.setText("Subtotal:");

        TotalLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        TotalLabel.setText("Total:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ItemLabel)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(25, 25, 25)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(TotalLabel, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(TaxLabel, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(SubTotalLabel, javax.swing.GroupLayout.Alignment.TRAILING))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TotalOut, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(NumberLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(SubTotalOut, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(TaxOut, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(SubTotalLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(DiscountOut, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NumberLabel)
                    .addComponent(ItemLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(SubTotalLabel1)
                    .addComponent(DiscountOut))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(SubTotalLabel)
                    .addComponent(SubTotalOut))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TaxLabel)
                    .addComponent(TaxOut))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TotalLabel)
                    .addComponent(TotalOut))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout CartPanelLayout = new javax.swing.GroupLayout(CartPanel);
        CartPanel.setLayout(CartPanelLayout);
        CartPanelLayout.setHorizontalGroup(
            CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CartPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(CartPanelLayout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(CartLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(CartLabel2))
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(46, Short.MAX_VALUE))
            .addComponent(CheckoutButton, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        CartPanelLayout.setVerticalGroup(
            CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CartPanelLayout.createSequentialGroup()
                .addComponent(CheckoutButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CartLabel1)
                    .addComponent(CartLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        SearchResultsButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        SearchResultsButton.setText("View Search Results");
        SearchResultsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SearchResultsButtonActionPerformed(evt);
            }
        });

        AddStoreCardButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        AddStoreCardButton.setText("Add Store Card");
        AddStoreCardButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddStoreCardButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout OptionsPanelLayout = new javax.swing.GroupLayout(OptionsPanel);
        OptionsPanel.setLayout(OptionsPanelLayout);
        OptionsPanelLayout.setHorizontalGroup(
            OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(OptionsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(CartPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(SearchResultsButton)
                        .addGroup(OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(SearchButton, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
                            .addComponent(AddStoreCardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        OptionsPanelLayout.setVerticalGroup(
            OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(OptionsPanelLayout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(SearchButton, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(SearchResultsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(AddStoreCardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(CartPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(39, Short.MAX_VALUE))
        );

        ISLabel.setFont(new java.awt.Font("Lucida Console", 0, 11));
        ISLabel.setText("Powered by Interactive Solutions");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(OptionsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(DynamicPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(880, Short.MAX_VALUE)
                .addComponent(ISLabel)
                .addContainerGap())
            .addComponent(TitlePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(TitlePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(DynamicPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(OptionsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(ISLabel)
                .addGap(58, 58, 58))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void AddStoreCardButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddStoreCardButtonActionPerformed
        if (sessionManager.getLoggedIn()){
            controller.removeStoreCard();
            setTotals();
        }
        else{
            controller.AddStoreCardScreen();
        }
    }//GEN-LAST:event_AddStoreCardButtonActionPerformed

    private void SearchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchButtonActionPerformed
        controller.SearchChoiceScreen();
    }//GEN-LAST:event_SearchButtonActionPerformed

    private void CheckoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckoutButtonActionPerformed
        controller.CartScreen();
    }//GEN-LAST:event_CheckoutButtonActionPerformed

    private void LoginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LoginButtonActionPerformed
        if (sessionManager.isClerkLoggedIn())
            controller.clerkLogout();
        else
            controller.ClerkLoginScreen();
    }//GEN-LAST:event_LoginButtonActionPerformed

    private void SearchResultsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchResultsButtonActionPerformed

        if (sessionManager.getCart().getSearchResults() != null){
            controller.SearchResultsScreen();
        }
    }//GEN-LAST:event_SearchResultsButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddStoreCardButton;
    private javax.swing.JLabel CartLabel1;
    private javax.swing.JLabel CartLabel2;
    private javax.swing.JPanel CartPanel;
    private javax.swing.JButton CheckoutButton;
    private javax.swing.JLabel DiscountOut;
    private javax.swing.JPanel DynamicPanel4;
    private javax.swing.JLabel HelloLabel;
    private javax.swing.JLabel ISLabel;
    private javax.swing.JLabel ItemLabel;
    private javax.swing.JButton LoginButton;
    private javax.swing.JLabel LogoLabel;
    private javax.swing.JLabel NameLabel;
    private javax.swing.JLabel NumberLabel;
    private javax.swing.JPanel OptionsPanel;
    private javax.swing.JButton SearchButton;
    private javax.swing.JButton SearchResultsButton;
    private javax.swing.JLabel SubTotalLabel;
    private javax.swing.JLabel SubTotalLabel1;
    private javax.swing.JLabel SubTotalOut;
    private javax.swing.JLabel TaxLabel;
    private javax.swing.JLabel TaxOut;
    private javax.swing.JPanel TitlePanel;
    private javax.swing.JLabel TotalLabel;
    private javax.swing.JLabel TotalOut;
    private javax.swing.JLabel WelcomeLabel;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

}
